import java.util.ArrayList;
import java.util.Scanner;

public class Test {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        ArrayList<String> arrayList = new ArrayList<>();
        while (sc.hasNext()) {
            String s = sc.next();
            if (s.charAt(s.length() - 1) == '!') {
                arrayList.add(s.substring(0, s.length() - 1));
                break;
            }
            else arrayList.add(s);
        }

        System.out.println(arrayList.size());
        for (int i = 0; i < arrayList.size(); i++) {
            System.out.println(arrayList.get(i));
        }
    }
}
